#ifndef _utils_h
#define _utils_h

#include "genlib.h"
#include "simpio.h"
#include "strlib.h"
#include "symtab.h"
#include "scanadt.h"

/* Constants */
#define NUM_ROWS 1000

/* Parsed row */
typedef struct {
	int row;			// 10
	string cmd;		// IF
	string rest;	// X < 1337 THEN 20
} lineT;

/* Program containing parsed rows */
typedef struct {
	int size;
	int numRows;
	lineT *entries;
} linesT;

/* Database struct */
typedef struct {
	symtabADT cmdTable;
	symtabADT varTable;
	scannerADT scanner;
	linesT lines;
	int PC;
} *dbT;

/* Program database */
extern dbT db;
//dbT db;

/* Returns the line index for the given row number */
int rowToIndex(int rowNum);

#endif